//
//  goodsListCollectionViewCell.m
//  lmq
//
//  Created by 千翼网络科技 on 2017/4/3.
//  Copyright © 2017年 yuanxin. All rights reserved.
//

#import "goodsListCollectionViewCell.h"
#import "configddd.h"
#import <Masonry/Masonry.h>

@implementation goodsListCollectionViewCell

-(id)initWithFrame:(CGRect)frame{
    
    if (self = [super initWithFrame:frame]) {
        
//        self.backgroundColor=[UIColor yellowColor];
        
        self.backView = [[UIView alloc]init];
        [self addSubview:self.backView];
        [self.backView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(self).with.offset(0);
            make.left.mas_equalTo(self).with.offset(screenScale(20));
            make.right.mas_equalTo(self).with.offset(screenScale(-20));
            
            make.height.mas_equalTo(screenScale(400));
        }];
        
        //显示图片
        self.imageshow=[[UIImageView alloc]initWithFrame:CGRectMake(0, screenScale(20), screenScale(270), screenScale(270))];
        [self.backView addSubview:self.imageshow];
        
        //名称
        self.myLabel=[[UILabel alloc]init];
        self.myLabel.textAlignment = NSTextAlignmentLeft;
//        self.myLabel.backgroundColor = [UIColor redColor];
        self.myLabel.numberOfLines = 0;
        self.myLabel.font = get4sFont(10);
        [self.backView addSubview:self.myLabel];
        [self.myLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(_imageshow).with.offset(screenScale(260));
            make.left.mas_equalTo(_imageshow).with.offset(0);
            make.bottom.mas_equalTo(_imageshow).with.offset(screenScale(80));
            make.right.mas_equalTo(_imageshow).with.offset(0);
        }];
        
        //价格
        _priceLable = [[UILabel alloc]init];
        _priceLable.textColor = getColor(@"252525");
        _priceLable.font = get4sFont(11);
        _priceLable.textAlignment = NSTextAlignmentLeft;
        [_backView addSubview:_priceLable];
        [_priceLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(_backView).with.offset(screenScale(-10));
            make.left.mas_equalTo(_backView).with.offset(0);
            
            make.height.mas_equalTo(screenScale(24));
        }];
        
        //旧价格
        _beforeLable = [[UILabel alloc]init];
        _beforeLable.textColor = getColor(@"9d9d9d");
        _beforeLable.font = get4sFont(11);
        _beforeLable.textAlignment = NSTextAlignmentLeft;
        [_backView addSubview:_beforeLable];
        [_beforeLable mas_makeConstraints:^(MASConstraintMaker *make) {
            make.bottom.mas_equalTo(_backView).with.offset(screenScale(-10));
            make.right.mas_equalTo(_priceLable).with.offset(screenScale(100));
            
            make.height.mas_equalTo(screenScale(24));
        }];
        
    }
    return self;
}

@end
